package com.liu.shop.common.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 发送邮箱模板
 */
public class Email implements Serializable {

    private String title;

    private String content;

    private List<String> toUserList = new ArrayList<>();

    public Email() {
    }

    public Email(String title, String content, String ...toUser) {
        this.title = title;
        this.content = content;
        // 把数组转成一个集合
        List<String> c = Arrays.asList(toUser);
        toUserList.addAll(c);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<String> getToUserList() {
        return toUserList;
    }

    public void setToUserList(String ...emails) {
        this.toUserList.addAll(Arrays.asList(emails));
    }

    @Override
    public String toString() {
        return "Email{" +
                "title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", toUserList=" + toUserList +
                '}';
    }
}
